{% extends 'layout/main.html' %}

{% block main %}
<div class="main-container container" id="main">

    <div class="row">
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-heading">个人资料设置</div>
                <div class="panel-body">
                    <form method="post" accept-charset="UTF-8" action="/account" id="edit_user"
                          class="simple_form form-horizontal edit_user" novalidate="novalidate"
                          enctype="multipart/form-data">
                        <input type="hidden" value="✓" name="utf8">
                        <input type="hidden" value="put" name="_method">
                        {{ xsrf_form_html() }}
                        <div class="form-group string optional user_name">
                            <label for="user_name" class="string optional control-label col-sm-2">名字</label>
                            <div class="col-sm-10">
                                <input type="text" id="user_name" name="username" value="" class="string optional form-control">
                            </div>
                        </div>
                        <div class="form-group file optional user_avatar">
                            <label for="user_avatar" class="file optional control-label col-sm-2">头像</label>
                            <div class="col-sm-10">
                                <input type="file" id="user_avatar" name="avatar" class="file optional form-control">
                            </div>
                        </div>
                        <div class="form-group email optional user_email">
                            <label for="user_email" class="email optional control-label col-sm-2">Email</label>
                            <div class="col-sm-10">
                                <input type="email" id="user_email" name="email" value="" disabled="disabled" class="string email optional span4 form-control">
                                <p class="help-block">保存以后就不可以改了哦！</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-2">
                                <div class="checkbox">
                                    <label class="checkbox" for="user_email_public">
                                        <input type="hidden" value="0" name="email_public">
                                        <input type="checkbox" id="user_email_public" name="email_public" value="1">公开 Email
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group string optional user_location">
                            <label for="user_location" class="string optional control-label col-sm-2">城市</label>
                            <div class="col-sm-10">
                                <input type="text" id="user_location" name="location" class="string optional form-control">
                                <p class="help-block">请用中文填写所在城市</p>
                            </div>
                        </div>

                        <div class="form-group string optional user_company">
                            <label for="user_company" class="string optional control-label col-sm-2">公司</label>
                            <div class="col-sm-10">
                                <input type="text" id="user_company" name="company" class="string optional form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="user_github" class="string optional control-label col-sm-2">GitHub</label>

                            <div class="col-sm-10">
                                <div class="input-group">
                                    <span class="input-group-addon">https://github.com/</span>
                                    <input type="email" id="user_github" name="user[github]" value="huaiguoguo"
                                           placeholder="yourname" class="form-control">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="user_twitter" class="string optional control-label col-sm-2">Twitter</label>

                            <div class="col-sm-10">
                                <div class="input-group">
                                    <span class="input-group-addon">http://twitter.com/</span>
                                    <input type="email" id="user_twitter" name="user[twitter]" placeholder="yourname"
                                           class="form-control">
                                </div>
                            </div>
                        </div>
                        <div class="form-group string optional user_website"><label for="user_website"
                                                                                    class="string optional control-label col-sm-2">个人主页</label>

                            <div class="col-sm-10"><input type="text" id="user_website" name="user[website]"
                                                          class="string optional form-control" placeholder="http://">
                            </div>
                        </div>
                        <div class="form-group string optional user_tagline"><label for="user_tagline"
                                                                                    class="string optional control-label col-sm-2">签名</label>

                            <div class="col-sm-10"><input type="text" id="user_tagline" name="user[tagline]"
                                                          class="string optional form-control"></div>
                        </div>
                        <div class="form-group text optional user_bio"><label for="user_bio"
                                                                              class="text optional control-label col-sm-2">个人介绍</label>

                            <div class="col-sm-10"><textarea id="user_bio" name="user[bio]" rows="6"
                                                             class="text optional xxlarge form-control"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-2">
                                <button data-disable-with="正在保存" class="btn btn-primary" type="submit">更新资料</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">修改密码</div>
                <div class="panel-body">
                    <form method="post" accept-charset="UTF-8" action="/account?by=pwd" id="edit_user"
                          class="simple_form form-horizontal edit_user" novalidate="novalidate"><input type="hidden"
                                                                                                       value="✓"
                                                                                                       name="utf8"><input
                            type="hidden" value="put" name="_method"><input type="hidden"
                                                                            value="3pRmXfCdMk9p5A6tlhkIQejCcMhCuCch7PUxOnOWKqp2BP3ErT516t2zhc6d4hD8UkX3NvBRoTHBn5phS44aeQ=="
                                                                            name="authenticity_token">

                        <input type="hidden" value="pwd" name="by">

                        <div class="form-group password optional user_current_password"><label
                                for="user_current_password" class="password optional control-label col-sm-2">旧密码</label>

                            <div class="col-sm-10"><input type="password" id="user_current_password"
                                                          name="user[current_password]"
                                                          class="password optional form-control"></div>
                        </div>
                        <div class="form-group password optional user_password"><label for="user_password"
                                                                                       class="password optional control-label col-sm-2">密码</label>

                            <div class="col-sm-10"><input type="password" id="user_password" name="user[password]"
                                                          class="password optional form-control"></div>
                        </div>
                        <div class="form-group password optional user_password_confirmation"><label
                                for="user_password_confirmation"
                                class="password optional control-label col-sm-2">确认密码</label>

                            <div class="col-sm-10"><input type="password" id="user_password_confirmation"
                                                          name="user[password_confirmation]"
                                                          class="password optional form-control"></div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-2">
                                <input type="submit" data-disable-with="正在保存" class="btn btn-success" value="修改密码"
                                       name="commit">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="sidebar col-md-3">
            <div style="text-align:center;" class="panel panel-default">
                <div class="panel-body">
                    <img alt="192" src="/static/accountImg/b_e4d80b30-151e-51b5-9f4f-18a3b82718e6.png"
                         class="media-object avatar-96">
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">绑定其他帐号用于登陆</div>
                <ul class="list-group">
                    <li class="list-group-item">
                        GitHub
                        <a href="/account/auth/github/unbind" data-method="delete" title="点击解除绑定" rel="twitsy nofollow"><i
                                class="fa fa-remove"></i></a>
                    </li>
                </ul>
            </div>

            <div class="panel panel-default">
                <ul class="list-group">
                    <li class="list-group-item"><a href="/oauth/applications">管理我的应用</a></li>
                </ul>
            </div>


            <div class="panel panel-default">
                <div class="panel-heading">密钥</div>
                <div class="panel-body">
                    <div class="form-group">
                        <input readonly="readonly" value="c1dbbed5b4c5affae614:19445" class="form-control"
                               id="private_token">
                    </div>
                    <div class="buttons">
                        <a id="update_private_token" class="btn btn-default btn-sm" href="#">更换一个</a> <span
                            class="help-inline">用于浏览器 Push 通知</span>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">删除账号</div>
                <div class="panel-body">
                    <form method="post" accept-charset="UTF-8" action="/account" id="edit_user" class="edit_user"><input
                            type="hidden" value="✓" name="utf8"><input type="hidden" value="delete"
                                                                       name="_method"><input type="hidden"
                                                                                             value="3pRmXfCdMk9p5A6tlhkIQejCcMhCuCch7PUxOnOWKqp2BP3ErT516t2zhc6d4hD8UkX3NvBRoTHBn5phS44aeQ=="
                                                                                             name="authenticity_token">

                        <input type="hidden" value="destroy" name="by">

                        <div class="form-group">
                            <input type="password" id="user_current_password" name="user[current_password]"
                                   placeholder="要删除账号，请输入你的密码" class="form-control">
                        </div>
                        <input type="submit" data-disable-with="正在提交" class="btn btn-danger btn-sm btn-block"
                               value="确定删除我的账号" name="commit">
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
{% endblock %}